using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using emp.Model;
using emp.ProcessFlow;

public partial class ItemManage_Item_Add : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string pID = "0";
            if (Request.Params["ID"] != null && Request.Params["ID"].Equals("")==false)
            {
                pID = Request.Params["ID"];
            }
            Parent_Item_ID.Text = pID;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            string ItemName = Item_Name.Text.Trim();
            string ItemDesc = Item_Desc.Text.Trim();
            int iParent_Item_ID = int.Parse(Parent_Item_ID.Text.Trim());
            ItemInfo iInfo = new ItemInfo(iParent_Item_ID,ItemName,ItemDesc);
            ItemController iCon = new ItemController();
            iCon.CreateItem(iInfo);
        }
    }
}
